﻿using MS_Entity;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace common
{
    //公共类
    public class Comon
    {
        public Comon() { }
        public List<Alarm> GetAlarmsParams(string Alarm)
        {
            List<Alarm> AlarmList = null;
            if(Alarm.Length > 0)
            {
                AlarmList = new List<Alarm>();
                string[] strArray = Alarm.Split('|');
                for(int i = 0; i < strArray.Length; i++)
                {
                    string[] res = strArray[i].Split(';');
                    AlarmList.Add(new Alarm()
                    {
                        AlarmType = res[0],
                        AlarmValue = Convert.ToInt32(res[1]),
                        Priority = Convert.ToInt32(res[2]),
                        Note = res[3]
                    });
                }
            }
            return AlarmList;
        }
      
    }
}
